package com.utils;

import com.dto.config.IniDTO;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;

public class TestCMD {


    /**
     * 打印log控制台
     */
    public static void cmdOpenFiles() throws IOException {
        System.out.println(IniDTO.getSftp_path());
        Process process = Runtime.getRuntime().exec("cmd /c start "+IniDTO.getSftp_path());
        Charset charset = Charset.forName("GBK");
        new Thread (() -> {
            try (InputStreamReader reader = new InputStreamReader(process.getInputStream(), charset)) {
                int read;
                while ((read = reader.read()) != -1) {
                    System.out.print((char) read);
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }).start();
    }



}
